package com.geekstudy;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(urlPatterns = "/demo", asyncSupported = false)
public class DemoServlet  extends HttpServlet {

    @Override
    public void service(HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws ServletException, IOException {
        httpResponse.getWriter().print("Demo Servlet");

        // httpResponse.sendRedirect();
        // httpRequest.getRequestDispatcher("welcome.jsp").include(httpRequest, httpResponse);
        // httpRequest.getRequestDispatcher("welcome.jsp").forward(httpRequest, httpResponse);
    }

}
